/**
 * 对"今日诗词-一言API"请求的封装
 * 今日诗词-一言API: https://www.jinrishici.com
 */
const shici = require('jinrishici')

export default function() {
  return new Promise((resolve) => {
    shici.load(result => {
      const data = {
        title: result.data.origin.title,
        author: result.data.origin.author,
        content: result.data.content
      }
      resolve(data)
    }, err => {
      console.error('诗词获取失败：', err);
    })
  })
}
